FROM golang:1.20.7-alpine AS builder

ENV CGO_ENABLED 0
ENV GOPROXY http://172.24.73.31:8081/repository/go-group,direct
# ENV GOPROXY https://goproxy.cn,direct

WORKDIR /build

COPY . .
RUN go build -ldflags="-s -w" -o /build/bin/app main.go


FROM scratch

WORKDIR /app
COPY --from=builder /build/bin/app /app/bin/app

CMD ["./bin/app"]
